package com.wr.springbootadmin.customizeExceptions;

import com.wr.springbootadmin.common.ResultCode;
import lombok.Data;

/**
 * @author 王瑞
 * @description: 自定义异常类
 * @date 2020/12/25  9:19
 */
@Data
public class CustomizeException extends RuntimeException {

    private Integer code;

    private String message;

    private CustomizeException(){}


    public CustomizeException(Integer code,String message){
        this.code = code;
        this.message = message;
    }

    public CustomizeException(ResultCode resultCode){
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

}
